package com.hyxf.controller;

import lombok.AllArgsConstructor;
import com.hyxf.core.R;
import com.hyxf.service.SyncDataSourceService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 阿紫
 * @version 1.0.0
 * @project sync-multiple-datasource
 * @description 同步数据接口
 * @date 2024/11/14 10:15:57
 */
@RestController
@AllArgsConstructor
@RequestMapping("/api/syncDataSource")
public class SyncDataSourceController {

    private SyncDataSourceService syncService;

    /**
     * 同步本地数据到远程
     * @return
     */
    @GetMapping("/syncDataSourceToRemote")
    public R syncDataSourceToRemote() {
        syncService.syncUserInfo();
        return R.ok();
    }
}
